<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>custom-checkbox</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .ew-checkbox-group {
            background-color: #fff;
            color: rgba(0, 0, 0, .85);
            height: 64px;
            display: flex;
            flex-wrap: row wrap;
            justify-content: center;
            align-items: center;
        }

        .ew-checkbox-group .ew-checkbox-symbol {
            width: 0;
            height: 0;
            position: absolute;
            pointer-events: none;
            user-select: none;
        }

        .ew-checkbox-group * {
            box-sizing: border-box;
        }

        .ew-checkbox-input {
            position: absolute;
            visibility: hidden;
        }

        .ew-checkbox {
            user-select: none;
            cursor: pointer;
            padding: 6px 8px;
            border-radius: 6px;
            overflow: hidden;
            transition: all .3s ease-in-out;
            display: flex;
        }

        .ew-checkbox:not(:last-of-type) {
            margin-right: 6px;
        }

        .ew-checkbox:hover {
            background-color: rgba(0, 120, 255, .06);
        }

        .ew-checkbox .ew-checkbox-item {
            vertical-align: middle;
            transform: translate3d(0, 0, 0);
        }

        .ew-checkbox .ew-checkbox-item:first-of-type {
            position: relative;
            flex: 0 0 18px;
            width: 18px;
            height: 18px;
            border-radius: 4px;
            transform: scale(1);
            border: 1px solid #cdcdfd;
            transition: all .4s ease;
        }

        .ew-checkbox .ew-checkbox-icon {
            position: absolute;
            top: 3px;
            left: 2px;
            fill: none;
            stroke: #fff;
            stroke-dasharray: 16px;
            stroke-dashoffset: 16px;
            transition: all .4s ease;
            transform: translate3d(0, 0, 0);
        }

        .ew-checkbox .ew-checkbox-item:last-of-type {
            padding-left: 8px;
            line-height: 18px;
        }

        .ew-checkbox:hover .ew-checkbox-item:first-of-type {
            border-color: #2396ef;
        }

        .ew-checkbox-input:checked+.ew-checkbox-item:first-of-type {
            animation: zoom-in-out .3s ease;
            background-color: #2396ef;
            border-color: #2396ef;
        }

        .ew-checkbox-input:checked+.ew-checkbox-item .ew-checkbox-icon {
            stroke-dashoffset: 0;
        }

        @keyframes zoom-in-out {
            50% {
                transform: scale(.9);
            }
        }
    </style>
</head>

<body>
    <div class="ew-checkbox-group">
        <label class="ew-checkbox">
            <svg class="ew-checkbox-symbol">
                <symbol id="ew-check" viewbox="0 0 12 10">
                    <polyline points="1.5 6 4.5 9 10.5 1" stroke-linecap="round" stroke-linejoin="round"
                        stroke-width="2">
                    </polyline>
                </symbol>
            </svg>
            <input type="checkbox" class="ew-checkbox-input">
            <span class="ew-checkbox-item">
                <svg class="ew-checkbox-icon" width="12px" height="10px">
                    <use xlink:href="#ew-check"></use>
                </svg>
            </span>
            <span class="ew-checkbox-item">
                Apples
            </span>
        </label>
        <label class="ew-checkbox">
            <input type="checkbox" class="ew-checkbox-input">
            <span class="ew-checkbox-item">
                <svg class="ew-checkbox-icon" width="12px" height="10px">
                    <use xlink:href="#ew-check"></use>
                </svg>
            </span>
            <span class="ew-checkbox-item">
                Oranges
            </span>
        </label>
    </div>
</body>

</html>